<?php
//session_start();

class login
{
	
	public $name;
	
	public function login(){
		
		if (isset($_SESSION['username'])){
			$this->name = $_SESSION['username'];
			//echo $/this->name;
			//session_destroy();
			$this->ver();
		}
		else{
			include_once 'views/view-inicio.php';
			$inicio = new view_inicio();
			$inicio->text = 'no has iniciado sesion';
			$inicio->ver();
		}
	}
	
	public function ver(){
?>
<html>
<head>
<title> usuario:  <?= $this->name; ?> </title>	
</head>
	<body style="background-color:#009900">
     	<div style="position:absolute; left: 10px; width: 20%; top:10px; height:20%; background-color:#0C0">
          <table width="100%" height="100%" align="center">
          	<tr align="center">
          		<td>
          			<h2><?= $this->name; ?><br></h2>
          		</td>
          	</tr>
               <tr align="center">
               	<td>
               		<a href="?action=close">cerrar sesion</a>
               	</td>
               </tr>
          </table>
          </div>
          
          <div style="position:absolute; left:21%; top:10px; height:20%; width:78%; background-color:#0C0">
          <table width="100%" height="100%">
          	<tr align="center" style="font-size:24px">
               	<td>
                    	<a href="?action=ver_personal">Personal</a>
                    </td>
                    <td>
                    	<a href="?action=ver_usuarios">Usuarios</a>
                    </td>
                    <td>
                    	<a href="">Repostes</a>
                    </td>
          	</tr>
          </table>
          </div>
</body>

</html>

<?php 
	}
}
?>